"""
登录接口 对象层
"""
import logging

import requests

from common.logging_use import init_log_config
from config import BASE_DIR


# 定义登录接口类
class LoginApi(object):
    init_log_config(BASE_DIR + '/log/Ihrm_001.log')

    # 登录 请求 方法
    @classmethod
    def login(cls,json_data):
        resp=requests.post(url="http://ihrm-java.itheima.net/api/sys/login",
                      json=json_data)
        return resp

# 测试
if __name__ == '__main__':
    data={"mobile":"13800000002","password":"929itheima.CN032@.20251021"}
    resp=LoginApi.login(data)
    print(resp.json())
    # logging.info(f"登录请求：{resp.json()}")